package testadvance;

/**
 * @author oldliu
 * @since 1.0
 */
public class StringTest {
    public static void main(String[] args) {
        String str="accp";
        str.toUpperCase();
        System.out.println(str);
        String s2=str;
        str="nihao";
        System.out.println(s2);
        byte b[]={65,66,67};
        String s3=new String(b);
        System.out.println(s3);
        String s5="大闸好，我是渣渣灰";
        int i = s5.indexOf('好', 6);
        System.out.println(i);
        String s6="I am a student";
        String ar[]=s6.split(" ");
        for(String t:ar)
            System.out.println(t);

        System.out.println(">>>>>>>>>>>>>>>>>>>>");
        //按照数字切割字符串
        s6="sdfaj#@$o3u4山坡的方式劳动法49392234236#skdfslfk4asdlfj23l324#99fff";
         ar=s6.split("\\d+");
        for(String t:ar)
            System.out.println(t);

        String s8=s6.replace('a','F');
        System.out.println(s8);
        String s9=s6.replaceAll("\\d+","你好");
        System.out.println(s9);
}
}
